<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>


<script type="text/javascript">
	$(function() {
		$("#pager").pager({pagenumber: ${pm.currentPage}, 
			pagecount: ${pm.totalPage},
			buttonClickCallback: function(page){
				$("#div_voteItem").load("getVoteItem.cms?page="+page+"&app=${app}");
			}
		});
	});
	
</script>


<a href="javascript:void(0);" onclick="showPostVote('${app}');">添加</a>
	<div id="div_voteList" align="center">
		
		<table width="100%" class="table_wrap">
			<tr>
				<td>排序</td>
				<td>Id</td>
				<c:if test="${app=='03' }"><td style="width: 50px;">类别</td></c:if>
				<td style="width: 100px;">标题</td>
				<td>内容</td>
				<td>图片</td>
				<td width="400">列项</td>
				<td>状态</td>
				<td style="width: 60px;">功能</td>
			</tr>
			<c:forEach items="${pm.list }" var="vote">
				<tr>
					<td align="center"><input type="text"  value="${vote.sort }" style="width: 20px;display: none;">${vote.sort }</td>
					<td>${vote.identifier }</td>
					<c:if test="${app=='03' }">
						<td>
							<c:if test="${vote.voteType=='01' }">酒店</c:if>
							<c:if test="${vote.voteType=='02' }">景区</c:if>
							<c:if test="${vote.voteType=='03' }">旅行社</c:if>
							<c:if test="${vote.voteType=='04' }">旅游客运</c:if>
							<c:if test="${vote.voteType=='05' }">旅游目的地</c:if>
						</td>
					</c:if>
					<td>${vote.title }</td>
					<td style="width: 300px;">${vote.bodyText }</td>
					<td><img src="${vote.picUrl }" width="100" height="50" alt="图片"></td>
					<td width="200">
						<a href="javascript:void(0)" onclick="showAddVoteItem('${vote.identifier }');" class="link_1">添加</a><br>
						<c:if test="${not empty vote.voitemList  }">
							<div style="height:282px; overflow:auto;width:360px;">
								<table class="detail_table">
									<tr><td>标题</td><td>投票数</td><td>图片</td><td>操作</td></tr>
									<c:forEach items="${vote.voitemList }" var="voteItem">
										<tr>
											<td width="80"><div style="width:80px; overflow:hidden; height:50px; text-align:left;">${voteItem.title }</div></td>
											<td width="50">${voteItem.votes }</td>
											<td width="50"><img src="${voteItem.picUrl }" width="50" height="30"/></td>
											<td>
												<a href="javascript:void(0)" onclick="modifyVoteItem('${voteItem.identifier}','${vote.identifier }')">修改</a>
												<a href="javascript:void(0)" onclick="deleteVoteItem('${voteItem.identifier}','${page }')">删除</a>
											</td>
										</tr>
									</c:forEach>
								</table>
							</div>
						</c:if>
					</td>
					<td>
						<c:if test="${vote.enabled==true }">可用</c:if>
						<c:if test="${vote.enabled==false }">已结束</c:if> 
					</td>
					<td class="func">
						<a href="javascript:void(0)" onclick="showModifyVote('${vote.identifier }');">修改</a> 
						<c:if test="${vote.enabled==true }"><a href="javascript:void(0)" onclick="closeVote('${vote.identifier}','${page }');">结束</a></c:if>
						<c:if test="${vote.enabled==false }"><a href="javascript:void(0)" onclick="openVote('${vote.identifier}','${page }');">可用</a></c:if> 
						<a href="javascript:void(0)" onclick="delVote('${vote.identifier }','${vote.sort }','${page }');">删除</a>
						<hr style="margin:10px 0;overflow:hidden;" />
						<a href="javascript:void(0)" onclick="addVoteSort('${vote.identifier }','${page }');">上移</a>
						<a href="javascript:void(0)" onclick="downVoteSort('${vote.identifier }','${page }');">下移</a>
					</td>
				</tr>
			</c:forEach>
		</table>
		<div id="pager" class="h_page">分页</div>
	</div>
	<div id="div_postVote"></div>

